package object;

import java.awt.Graphics;
import java.awt.image.BufferedImage;

/**
 *
 * Class containing information about the tiles, the building blocks of the level
 */

public class Tile
{
    private int mapX, mapY;
    private int imageID;
    private int locY;
    private int height;

    private BufferedImage bufImage;

    public Tile(int id, int x, int y)
    {
        mapX=x;
        mapY=y;
        imageID=id;
    }

    public int getMapX()
    {
        return mapX;
    }

    public int getMapY()
    {
        return mapY;
    }

    public int getImageID()
    {
        return imageID;
    }


    public void setImage(BufferedImage buf)
    {
        bufImage=buf;
        height=bufImage.getHeight();
    }


    public void setLocY(int pHeight, int maxYBricks)
    {
        locY=pHeight-((maxYBricks-mapY)*height);
    }

    public int getLocY()
    {
        return locY;
    }

    public void display(Graphics g, int xScr)
    {
        g.drawImage(bufImage,xScr,locY,null);
    }

}
